#ifndef LOADINGBUTTON_H
#define LOADINGBUTTON_H

#include <QPushButton>

class LoadingButton : public QPushButton
{
    Q_OBJECT
public:
    LoadingButton(QWidget *parent = nullptr);
    void startLoading();
    void stopLoading();

protected:
    void paintEvent(QPaintEvent *event) override;

protected slots:
    void updateAnimation();

private:
    QTimer *timer;
    int angle;    //这是角度
    bool loading; //当前是否在加载中
};

#endif // LOADINGBUTTON_H
